// 全局样式
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: @line-height-normal;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: @bg-color;
  color: @text-color;
}

#app {
  min-height: 100vh;
}

// 重置样式
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: @font-weight-semibold;
  line-height: @line-height-tight;
}

p {
  margin: 0;
  line-height: @line-height-normal;
}

ul, ol {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

a {
  color: @primary-color;
  text-decoration: none;
  transition: color @transition-fast;
  
  &:hover {
    color: darken(@primary-color, 10%);
  }
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  overflow: visible;
  text-transform: none;
  -webkit-appearance: button;
  cursor: pointer;
  
  &::-moz-focus-inner {
    border-style: none;
    padding: 0;
  }
  
  &:-moz-focusring {
    outline: 1px dotted ButtonText;
  }
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  overflow: visible;
}

// 工具类
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 @spacing;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: @spacing-xs;
}

.gap-2 {
  gap: @spacing-sm;
}

.gap-4 {
  gap: @spacing;
}

.gap-6 {
  gap: @spacing-md;
}

.gap-8 {
  gap: @spacing-lg;
}

// 响应式工具类
@media (max-width: @screen-sm) {
  .container {
    padding: 0 @spacing-sm;
  }
  
  .sm\:hidden {
    display: none;
  }
  
  .sm\:block {
    display: block;
  }
  
  .sm\:flex {
    display: flex;
  }
  
  .sm\:text-sm {
    font-size: @font-size-sm;
  }
  
  .sm\:text-base {
    font-size: @font-size-base;
  }
}

@media (max-width: @screen-md) {
  .md\:hidden {
    display: none;
  }
  
  .md\:block {
    display: block;
  }
  
  .md\:flex {
    display: flex;
  }
  
  .md\:grid {
    display: grid;
  }
  
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: @screen-lg) {
  .lg\:hidden {
    display: none;
  }
  
  .lg\:block {
    display: block;
  }
  
  .lg\:flex {
    display: flex;
  }
  
  .lg\:grid {
    display: grid;
  }
  
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

// 动画
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: @bg-light;
  border-radius: @border-radius;
}

::-webkit-scrollbar-thumb {
  background: @border-color;
  border-radius: @border-radius;
  
  &:hover {
    background: @text-lighter;
  }
}

// 选择文本样式
::selection {
  background: @primary-color;
  color: white;
}

::-moz-selection {
  background: @primary-color;
  color: white;
}
